/*    */ package com.zimbra.cs.filter;
/*    */ 
/*    */ import org.apache.jsieve.parser.SieveNode;
/*    */ import org.apache.jsieve.parser.generated.Node;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class TagDeleted
/*    */   extends SieveVisitor
/*    */ {
/*    */   private String mDeletedTagName;
/*    */   private Node mIfNode;
/* 30 */   private boolean mModified = false;
/*    */   
/*    */   public TagDeleted(String deletedTagName) {
/* 33 */     this.mDeletedTagName = deletedTagName;
/*    */   }
/*    */   
/*    */   public boolean modified() {
/* 37 */     return this.mModified;
/*    */   }
/*    */   
/*    */   protected void visitNode(Node node, SieveVisitor.VisitPhase phase, SieveVisitor.RuleProperties props)
/*    */   {
/* 42 */     if (phase != SieveVisitor.VisitPhase.begin) {
/* 43 */       return;
/*    */     }
/* 45 */     String name = getNodeName(node);
/* 46 */     if (("if".equals(name)) || ("disabled_if".equals(name)))
/*    */     {
/* 48 */       this.mIfNode = node;
/*    */     }
/*    */   }
/*    */   
/*    */   protected void visitTagAction(Node node, SieveVisitor.VisitPhase phase, SieveVisitor.RuleProperties props, String tagName)
/*    */   {
/* 54 */     if (phase != SieveVisitor.VisitPhase.begin) {
/* 55 */       return;
/*    */     }
/* 57 */     String ifNodeName = getNodeName(this.mIfNode);
/* 58 */     if ((tagName.equals(this.mDeletedTagName)) && ("if".equals(ifNodeName))) {
/* 59 */       ((SieveNode)this.mIfNode).setName("disabled_if");
/* 60 */       this.mModified = true;
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/filter/TagDeleted.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */